package com.dameng.jianyouquan.mvp.presenter.impl;

import com.dameng.jianyouquan.base.mvpBase.BasePresenterImpl;
import com.dameng.jianyouquan.mvp.model.ForgetPwdModel;
import com.dameng.jianyouquan.mvp.presenter.ModifyPwdPresenter;
import com.dameng.jianyouquan.mvp.view.view.ForgetPwdView;

public class ModifyPwdPresenterImpl extends BasePresenterImpl<ForgetPwdView> implements ModifyPwdPresenter, ForgetPwdModel.OnModifyPwdListener, ForgetPwdModel.OnSendVerificationCodeListener {


    ForgetPwdModel mModel;
    ForgetPwdView mView;

    public ModifyPwdPresenterImpl(ForgetPwdModel mModel, ForgetPwdView mView) {
        this.mModel = mModel;
        this.mView = mView;
    }

    @Override
    public void sendSuccess() {
        mView.sendVerificationCodeSuccess();
    }

    @Override
    public void sendFail(String msg) {
        mView.sendVerificationCodeFail(msg);
    }

    @Override
    public void modifySuccess() {
        mView.modifyPwdSuccess();
    }

    @Override
    public void modifyFail(String msg) {
        mView.modeifyPwdFail(msg);
    }


    @Override
    public void sendVerificationCode(String phoneNum) {
        mModel.sendVerificationCode(phoneNum,this);
    }

    @Override
    public void modifyPwd(String phoneNum, String VerificationCode, String pwd, String pwdConfirm) {
        mModel.modifyPwd(phoneNum,VerificationCode,pwd,pwdConfirm,this);
    }
}
